package by.brest.bspc.reporter.jasperreports.utils;

import net.sf.jasperreports.engine.JRPrintElement;
import net.sf.jasperreports.engine.JRPrintText;
import net.sf.jasperreports.engine.JasperPrint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_AVG;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_AVG_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_BASIS;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_BRANCH_MANAGER_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_CARD_HEADER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_CLASS_NUMBER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_CLASS_NUMBER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_COEFFICIENT;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_COEFFICIENT_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DATE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DEGREE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DEGREE_HEADER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DEGREE_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DIRESPECT_TRUANCIES;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DISCIPLINE_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_DISCIPLINE_NAME_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_FIO;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_FIO_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_FIRST_SEMESTER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_FIRST_SEMESTER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_GROUP_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_GROUP_NAME_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_HOURS_COUNT;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_HOURS_COUNT_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_LIST_HEADER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_MARK1;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_MARK2;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_MARK3;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_NUMBER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_NUMBER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_OTHER_BASIS;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_OTHER_BASIS_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_PAGE_NUMBER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_QUALITY;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_QUALITY_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_RESPECT_TRUANCIES;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_RESULT;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_RESULT_RECORD;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_RESULT_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SECOND_SEMESTER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SECOND_SEMESTER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SECRETARY_BSUY_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SPECIALTY;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SPECIALTY_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SUMMARY_REPORT_AVG;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SUMMARY_REPORT_DISCIPLINE_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_SUMMARY_REPORT_FIO;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_TOTAL_TRUANCIES;
import static by.brest.bspc.reporter.jasperreports.utils.JasperElements.TEXT_FIELD_UNIONS_CHAIRMAN_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.AVG;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.DIRESPECT_TRUANCIES;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.DISCIPLINES;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.FIO;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.MARK1;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.MARK2;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.MARK3;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.RESPECT_TRUANCIES;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_AVG;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_AVG_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_BASIS;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_BRANCH_MANAGER_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_CARD_HEADER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_CLASS_NUMBER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_CLASS_NUMBER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_COEFFICIENT;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_COEFFICIENT_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_DATE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_DEGREE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_DEGREE_HEADER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_DEGREE_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_DISCIPLINE_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_DISCIPLINE_NAME_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_FIO;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_FIO_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_FIRST_SEMESTER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_FIRST_SEMESTER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_GROUP_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_GROUP_NAME_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_HOURS_COUNT;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_HOURS_COUNT_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_LIST_HEADER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_NUMBER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_NUMBER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_OTHER_BASIS;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_OTHER_BASIS_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_PAGE_NUMBER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_QUALITY;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_QUALITY_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_RESULT;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_RESULT_RECORD;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_RESULT_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_SECOND_SEMESTER;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_SECOND_SEMESTER_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_SECRETARY_BSUY_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_SPECIALTY;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_SPECIALTY_VALUE;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.STATIC_TEXT_UNIONS_CHAIRMAN_NAME;
import static by.brest.bspc.reporter.jasperreports.utils.JasperStaticText.TOTAL_TRUANCIES;
import static org.junit.Assert.assertTrue;

/**
 * This class contains methods for verification reports data and test data.
 *
 * @date: 01.10.13 16:44
 * @author: Natallia
 */
public class ReportVerification {
    private static final Logger LOG = LoggerFactory.getLogger(ReportVerification.class);

    public static void verifyStudyCard(JasperPrint jasperPrint) {
        LOG.debug(">> Verifying report from template: " + jasperPrint.getName());

        List<JRPrintElement> elements = jasperPrint.getPages().get(0).getElements();
        for (JRPrintElement element : elements) {

            if (element.getKey().equals(TEXT_FIELD_CARD_HEADER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_CARD_HEADER));
            }
            if (element.getKey().equals(TEXT_FIELD_NUMBER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_NUMBER));
            }
            if (element.getKey().equals(TEXT_FIELD_DISCIPLINE_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_DISCIPLINE_NAME));
            }
            if (element.getKey().equals(TEXT_FIELD_HOURS_COUNT)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_HOURS_COUNT));
            }
            if (element.getKey().equals(TEXT_FIELD_FIRST_SEMESTER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_FIRST_SEMESTER));
            }
            if (element.getKey().equals(TEXT_FIELD_SECOND_SEMESTER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_SECOND_SEMESTER));
            }
            if (element.getKey().equals(TEXT_FIELD_NUMBER_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_NUMBER_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_DISCIPLINE_NAME_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_DISCIPLINE_NAME_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_HOURS_COUNT_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_HOURS_COUNT_VALUE));
            }
            if (element.getKey().equals(TEXT_FIELD_FIRST_SEMESTER_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_FIRST_SEMESTER_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_SECOND_SEMESTER_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_SECOND_SEMESTER_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_RESULT_RECORD)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_RESULT_RECORD));
            }
            if (element.getKey().equals(TEXT_FIELD_BRANCH_MANAGER_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_BRANCH_MANAGER_NAME));
            }
        }

        LOG.debug(">> Verifying was finished.");
    }

    public static void verifyScholarshipList(JasperPrint jasperPrint) {
        LOG.debug(">> Verifying report from template: " + jasperPrint.getName());

        List<JRPrintElement> elements = jasperPrint.getPages().get(0).getElements();
        for (JRPrintElement element : elements) {

            if (element.getKey().equals(TEXT_FIELD_LIST_HEADER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_LIST_HEADER));
            }
            if (element.getKey().equals(TEXT_FIELD_NUMBER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_NUMBER));
            }
            if (element.getKey().equals(TEXT_FIELD_FIO)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_FIO));
            }
            if (element.getKey().equals(TEXT_FIELD_CLASS_NUMBER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_CLASS_NUMBER));
            }
            if (element.getKey().equals(TEXT_FIELD_GROUP_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_GROUP_NAME));
            }
            if (element.getKey().equals(TEXT_FIELD_SPECIALTY)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_SPECIALTY));
            }
            if (element.getKey().equals(TEXT_FIELD_BASIS)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_BASIS));
            }
            if (element.getKey().equals(TEXT_FIELD_RESULT)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_RESULT));
            }
            if (element.getKey().equals(TEXT_FIELD_OTHER_BASIS)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_OTHER_BASIS));
            }
            if (element.getKey().equals(TEXT_FIELD_COEFFICIENT)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_COEFFICIENT));
            }
            if (element.getKey().equals(TEXT_FIELD_NUMBER_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_NUMBER_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_FIO_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_FIO_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_CLASS_NUMBER_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_CLASS_NUMBER_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_GROUP_NAME_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_GROUP_NAME_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_SPECIALTY_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_SPECIALTY_VALUE));
            }
            if (element.getKey().equals(TEXT_FIELD_RESULT_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_RESULT_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_OTHER_BASIS_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_OTHER_BASIS_VALUE));
            }
            if (element.getKey().equals(TEXT_FIELD_COEFFICIENT_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_COEFFICIENT_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_PAGE_NUMBER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_PAGE_NUMBER));
            }
            if (element.getKey().equals(TEXT_FIELD_BRANCH_MANAGER_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_BRANCH_MANAGER_NAME));
            }
            if (element.getKey().equals(TEXT_FIELD_UNIONS_CHAIRMAN_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_UNIONS_CHAIRMAN_NAME));
            }
            if (element.getKey().equals(TEXT_FIELD_SECRETARY_BSUY_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_SECRETARY_BSUY_NAME));
            }
            if (element.getKey().equals(TEXT_FIELD_DATE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_DATE));
            }
        }

        LOG.debug(">> Verifying was finished.");
    }

    public static void verifyDegreeOfTrainingGroups(JasperPrint jasperPrint) {
        LOG.debug(">> Verifying report from template: " + jasperPrint.getName());

        List<JRPrintElement> elements = jasperPrint.getPages().get(0).getElements();
        for (JRPrintElement element : elements) {

            if (element.getKey().equals(TEXT_FIELD_DEGREE_HEADER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_DEGREE_HEADER));
            }
            if (element.getKey().equals(TEXT_FIELD_NUMBER)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_NUMBER));
            }
            if (element.getKey().equals(TEXT_FIELD_GROUP_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_GROUP_NAME));
            }
            if (element.getKey().equals(TEXT_FIELD_AVG)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_AVG));
            }
            if (element.getKey().equals(TEXT_FIELD_DEGREE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_DEGREE));
            }
            if (element.getKey().equals(TEXT_FIELD_QUALITY)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_QUALITY));
            }
            if (element.getKey().equals(TEXT_FIELD_NUMBER_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_NUMBER_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_GROUP_NAME_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_GROUP_NAME_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_AVG_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_AVG_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_DEGREE_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_DEGREE_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_QUALITY_VALUE)) {
                assertTrue(">> " + element.getKey() + " is not equals!", STATIC_TEXT_QUALITY_VALUE.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_BRANCH_MANAGER_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", ((JRPrintText) element).getOriginalText().equals(STATIC_TEXT_BRANCH_MANAGER_NAME));
            }
        }

        LOG.debug(">> Verifying was finished.");
    }

    public static void verifySummaryReport(JasperPrint jasperPrint) {
        LOG.debug(">> Verifying report from template: " + jasperPrint.getName());

        List<JRPrintElement> elements = jasperPrint.getPages().get(0).getElements();
        for (JRPrintElement element : elements) {
            if (element.getKey().equals(TEXT_FIELD_SUMMARY_REPORT_FIO)) {
                assertTrue(">> " + element.getKey() + " is not equals!", FIO.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_MARK1)) {
                assertTrue(">> " + element.getKey() + " is not equals!", MARK1.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_MARK2)) {
                assertTrue(">> " + element.getKey() + " is not equals!", MARK2.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_MARK3)) {
                assertTrue(">> " + element.getKey() + " is not equals!", MARK3.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().contains(TEXT_FIELD_SUMMARY_REPORT_DISCIPLINE_NAME)) {
                assertTrue(">> " + element.getKey() + " is not equals!", DISCIPLINES.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_SUMMARY_REPORT_AVG)) {
                assertTrue(">> " + element.getKey() + " is not equals!", AVG.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_TOTAL_TRUANCIES)) {
                assertTrue(">> " + element.getKey() + " is not equals!", TOTAL_TRUANCIES.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_RESPECT_TRUANCIES)) {
                assertTrue(">> " + element.getKey() + " is not equals!", RESPECT_TRUANCIES.contains(((JRPrintText) element).getOriginalText()));
            }
            if (element.getKey().equals(TEXT_FIELD_DIRESPECT_TRUANCIES)) {
                assertTrue(">> " + element.getKey() + " is not equals!", DIRESPECT_TRUANCIES.contains(((JRPrintText) element).getOriginalText()));
            }
        }

        LOG.debug(">> Verifying was finished.");
    }

}

